home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / D51_NARexx / WinSwap.dopus5 < prev   
Text File  |  1995-12-26  |  3KB  |  76 lines

  1. /* WinSwap for Directory Opus 5.
  2.  By Leo 'Nudel' Davidson for Gods'Gift Utilities
  3.  email: leo.davidson@keble.oxford.ac.uk  www: http://info.ox.ac.uk/~kebl0364/
  4.  
  5. $VER: WinSwap.dopus5 1.4 (26.12.95)
  6.  
  7.    NOTE: This script _requires_ DOpus v5.11 or above.
  8.    NOTE: DOpusFuncs is an assembler version of this (and other) scripts.
  9.  
  10.    This script will swap around your source and destination listers,
  11.    like the old swap command in DOpus4.
  12.  
  13.    Obviously, in DOpus5 it is possible to simply move the two lister
  14.    windows, but somethimes this isn't desireable. For example, when they
  15.    are locked in place via the option in the pull-off menu; when you're
  16.    too lazy to move the windows; or when the two windows are positioned
  17.    such that moving them would be difficult or would make a mess.
  18.  
  19. Call as:
  20. ------------------------------------------------------------------------------
  21. ARexx    DOpus5:ARexx/WinSwap.dopus5 {Qp}
  22. ------------------------------------------------------------------------------
  23. Turn off all switches.
  24.  
  25.    v1.01 -> v1.02 - Made "PathOnly" the default behaviour and removed the
  26.                     option to copy the window dimensions (Did anyone want it?).
  27.                     Some minor tidying up.
  28.                     Now checks to make sure the DOPUS.x port exists.
  29.     v1.02 -> v1.3 - Now uses Show() instead of ShowList(). (Thanks Stoebi)
  30.                     Style Guide compliant version numbering and $VER string.
  31.      v1.3 -> v1.4 - Works properly with paths containing spaces, finally.
  32. */
  33.  
  34. options results
  35. options failat 99
  36. signal on syntax;signal on ioerr        /* Error trapping */
  37. parse arg DOpusPort
  38. DOpusPort = Strip(DOpusPort,"B",'" ')
  39.  
  40. If DOpusPort="" THEN Do
  41.     Say "Not correctly called from Directory Opus 5!"
  42.     Say "Load this ARexx script into an editor for more info."
  43.     EXIT
  44.     END
  45. If ~Show("P",DOpusPort) Then Do
  46.     Say DOpusPort "is not a valid port."
  47.     EXIT
  48.     End
  49. Address value DOpusPort
  50.  
  51. lister query source stem source_handle.
  52.  
  53. IF source_handle.count = 0 | source_handle.count = "SOURCE_HANDLE.COUNT" Then Do
  54.     dopus request '"You must have a SOURCE lister!" OK'
  55.     EXIT
  56.     End
  57.  
  58.  
  59. lister query dest stem dest_handle.
  60.  
  61. IF dest_handle.count = 0 | dest_handle.count = "DEST_HANDLE.COUNT" Then Do
  62.     dopus request '"You must have a DESTINATION lister!" OK'
  63.     EXIT
  64.     End
  65.  
  66. lister query source_handle.0 path
  67. source_path = RESULT
  68. lister query dest_handle.0 path
  69. dest_path = RESULT
  70.  
  71. lister read source_handle.0 '"'||dest_path||'"'
  72. lister read dest_handle.0 '"'||source_path||'"'
  73.  
  74. syntax:;ioerr:                /* In case of error, jump here */
  75. EXIT
  76.